package com.liang.consumer;

import com.liang.common.model.User;
import com.liang.common.service.UserService;
import com.liang.liangrpccore.proxy.ServiceProxyFactory;


/**
 * 简易服务消费者示例
 */

public class EasyConsumerExample {

    public static void main(String[] args) {
        // 需要获取UserService的实现类对象
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setUsername("liangzhaowei");
        // 调用
        User newUser = userService.getUser(user);
        if (newUser != null){
            System.out.println("获取用户信息成功：" + newUser.getUsername());
        }else {
            System.out.println("获取用户信息失败！");
        }
    }
}
